//
//  ViewController.m
//  TransValue
//
//  Created by student on 16/2/25.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewControllerA.h"
#import "ViewControllerB.h"
#import "ViewControllerC.h"

@interface ViewControllerA ()

@end

@implementation ViewControllerA

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if([segue.identifier isEqualToString:@"gotoB"])
    {
        ViewControllerB *vcB = segue.destinationViewController;
        vcB.username = self.usernameTextField.text;
        vcB.password = self.passwordTextField.text;
        vcB.email = self.emailTextField.text;
    }
    else if ([segue.identifier isEqualToString:@"gotoC"])
    {
        ViewControllerC *vcC = segue.destinationViewController;
        vcC.delegate = self;
    }
}

- (void)transUserName:(NSString *)u andPassword:(NSString *)p andEmail:(NSString *)e
{
    self.registerResultLabel.text = [NSString stringWithFormat:@"%@,%@,%@",e,u,p];
}

@end
